<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>自然资源添加页面</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css" />
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar">
        <div class="m-title">{{action=='Add'?'添加自然资源信息':action=='Modify'?'修改自然资源信息':''}}</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'natural_resources_management', 'form': 'dataForm' ,'primary_key':'Natural_Resource_SerialNumber' })">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">自然资源标签</div>
        </div>
        <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
          <el-descriptions :column="1" size="large" border>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">适用标签</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请选择适用标签', trigger: 'blur' }]"
                prop="Natural_Resource_Tag_SerialNumber">
                <el-select @change="changeTag" clearable v-model.trim="dataForm.Natural_Resource_Tag_SerialNumber"
                  placeholder="请选择适用标签" filterable style="width: 100%">
                  <el-option v-for="(item,index) in natural_resources_tags" :key="index"
                    :label="item.Natural_Resource_Tag" :value="item.Natural_Resource_Tag_SerialNumber"></el-option>
                </el-select>
              </el-form-item>
            </el-descriptions-item>
          </el-descriptions>
        </el-form>
        <div id="ChildTable">
          <div class="table_titel">
            <div class="titel">关联自然资源{{!dataForm.Natural_Resource_Tag_SerialNumber?'(请选择适用标签)':''}}</div>
            <div class="operation">
              <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove('childDataForm')">删除</el-button>
            </div>
          </div>
          <el-form v-if="dataForm.Natural_Resource_Tag_SerialNumber" :model="{childDataForm}" ref="form1"
            :inline-message="true" style="width: 100%">
            <el-descriptions :column="2" size="large" border>
              <el-descriptions-item v-for="(item,index) in childDataForm.filter(i=>i.Row_Status != '1')" :key="index">
                <template #label>
                  <div class="cell-item">自然资源</div>
                </template>
                <el-form-item :rules="[{ required: true, message: '请选择绑定自然资源', trigger: 'change' }]"
                  :prop="'childDataForm.'+index+'.Natural_Resource_SerialNumber'">
                  <yl-select v-model="item.Natural_Resource_SerialNumber" clearable filterable
                    placeholder="请选择请选择绑定自然资源"
                    :options=" natural_resources_management.filter(i=>i.Natural_Resource_SerialNumber==childDataForm[index].Natural_Resource_SerialNumber||!childDataForm.filter(item => item.Row_Status != '1').some(x=>i.Natural_Resource_SerialNumber==x.Natural_Resource_SerialNumber))" :props="{value:'Natural_Resource_SerialNumber',label:'Natural_Resource_Name'}">
                    <el-table-column prop="Natural_Resource_SerialNumber" min-width="180" show-overflow-tooltip
                      label="自然资源编号"></el-table-column>
                    <el-table-column prop="Natural_Resource_Name" min-width="180" show-overflow-tooltip
                      label="自然资源名称"></el-table-column>
                    <el-table-column prop="Area" show-overflow-tooltip min-width="180" label="占地面积"></el-table-column>
                  </yl-select>
                </el-form-item>
              </el-descriptions-item>
            </el-descriptions>
          </el-form>
        </div>
      </div>
    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
    </footer>
  </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/add.js"></script>

</html>